<?php
	class noidungtinbs
	{
		public $MaBaiViet = 0;
		public $MaChuDe = 0;
		public $MaNguoiDung = 0;
		public $TieuDe = "";
		public $TomTat = "";
		public $NoiDung = "";
		public $HinhAnh = "";
		public $TenAnh = "";
		public $NgayDang = "0000-00-00";
		public $LuotXem = 0;
		public $KiemDuyet = 0;
		
		public function Add()
		{
			$db = new noidungtindb();
			return $db->Add($this->MaBaiViet,
							 $this->MaChuDe,
							 $this->MaNguoiDung,
							 $this->TieuDe,
							 $this->TomTat,
							 $this->NoiDung,
							 $this->HinhAnh,
							 $this->TenAnh,
							 $this->NgayDang,
							 $this->LuotXem,
							 $this->KiemDuyet);			 
		}
		
		public function Update()
		{
			$db = new noidungtindb();
			return $db->Update($this->MaBaiViet, $this->MaChuDe, $this->TieuDe, $this->TomTat, $this->NoiDung, $this->HinhAnh, $this->TenAnh);
		}
		
		public function Delete()
		{
			$db = new noidungtindb();
			return $db->Delete($this->MaBaiViet);
		}
		
		public function GetAllList()
		{
			$db = new noidungtindb();
			return $db->GetAllList($this->MaBaiViet);
		}
		
		public function GetAllListCheck()
		{
			$db = new noidungtindb();
			return $db->GetAllListCheck($this->KiemDuyet);
		}
		
		public function SortGetAllList()
		{
			$db = new noidungtindb();
			return $db->SortGetAllList();
		}
		
		public function SortGetPageList($start = 0, $limit = 10)
		{
			$db = new noidungtindb();
			return $db->SortGetPageList($start, $limit);
		}
		
		public function SortGetCatalogPageList($start = 0, $limit = 10)
		{
			$db = new noidungtindb();
			return $db->SortGetCatalogPageList($this->MaChuDe, $start, $limit);
		}
		
		public function SortGetCatalogList()
		{
			$db = new noidungtindb();
			return $db->SortGetCatalogList($this->MaChuDe);
		}
		
		public function SortGetView()
		{
			$db = new noidungtindb();
			return $db->SortGetView();
		}
		
		public function AscNumView()
		{
			$db = new noidungtindb();
			return $db->AscNumView($this->MaBaiViet);
		}
		
		public function CheckArticle()
		{
			$db = new noidungtindb();
			return $db->CheckArticle($this->MaBaiViet, $this->KiemDuyet);
		}
		
		public function Find($start = 0, $limit = 10)
		{
			$db = new noidungtindb();
			return $db->Find($this->TieuDe, $start, $limit);
		}
	}
?>